3.195 \(\int \cot ^2(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=21 \[ -(x (a-b))-\frac {a \cot (e+f x)}{f} \]

[Out]

-(a-b)*x-a*cot(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3629, 8} \[ x (-(a-b))-\frac {a \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a - b)*x) - (a*Cot[e + f*x])/f

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3629

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[
((A*b^2 + a^2*C)*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*
Tan[e + f*x])^(m + 1)*Simp[a*(A - C) - (A*b - b*C)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, C}, x] &&
 NeQ[A*b^2 + a^2*C, 0] && LtQ[m, -1] && NeQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int \cot ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=-\frac {a \cot (e+f x)}{f}+\int (-a+b) \, dx\\ &=-(a-b) x-\frac {a \cot (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.02, size = 34, normalized size = 1.62 \[ b x-\frac {a \cot (e+f x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(e+f x)\right )}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

b*x - (a*Cot[e + f*x]*Hypergeometric2F1[-1/2, 1, 1/2, -Tan[e + f*x]^2])/f

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 29, normalized size = 1.38 \[ -\frac {{\left (a - b\right )} f x \tan \left (f x + e\right ) + a}{f \tan \left (f x + e\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a - b)*f*x*tan(f*x + e) + a)/(f*tan(f*x + e))

________________________________________________________________________________________

giac [B]  time = 2.32, size = 46, normalized size = 2.19 \[ -\frac {2 \, {\left (f x + e\right )} {\left (a - b\right )} - a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + \frac {a}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

-1/2*(2*(f*x + e)*(a - b) - a*tan(1/2*f*x + 1/2*e) + a/tan(1/2*f*x + 1/2*e))/f

________________________________________________________________________________________

maple [A]  time = 0.51, size = 31, normalized size = 1.48 \[ \frac {\left (f x +e \right ) b +a \left (-\cot \left (f x +e \right )-f x -e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*((f*x+e)*b+a*(-cot(f*x+e)-f*x-e))

________________________________________________________________________________________

maxima [A]  time = 0.67, size = 27, normalized size = 1.29 \[ -\frac {{\left (f x + e\right )} {\left (a - b\right )} + \frac {a}{\tan \left (f x + e\right )}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-((f*x + e)*(a - b) + a/tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 11.47, size = 21, normalized size = 1.00 \[ -x\,\left (a-b\right )-\frac {a\,\mathrm {cot}\left (e+f\,x\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)^2*(a + b*tan(e + f*x)^2),x)

[Out]

- x*(a - b) - (a*cot(e + f*x))/f

________________________________________________________________________________________

sympy [A]  time = 0.78, size = 46, normalized size = 2.19 \[ \begin {cases} \tilde {\infty } a x & \text {for}\: \left (e = 0 \vee e = - f x\right ) \wedge \left (e = - f x \vee f = 0\right ) \\x \left (a + b \tan ^{2}{\relax (e )}\right ) \cot ^{2}{\relax (e )} & \text {for}\: f = 0 \\- a x - \frac {a}{f \tan {\left (e + f x \right )}} + b x & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)**2*(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*a*x, (Eq(e, 0) | Eq(e, -f*x)) & (Eq(f, 0) | Eq(e, -f*x))), (x*(a + b*tan(e)**2)*cot(e)**2, Eq(f
, 0)), (-a*x - a/(f*tan(e + f*x)) + b*x, True))

________________________________________________________________________________________